<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_PUC;?>/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_PUC;?>/css/main.css"/>
    <script type="text/javascript" src="<?php echo ADMIN_PUC;?>/js/libs/modernizr.min.js"></script>
    <script type="text/javascript" src="<?php echo ADMIN_PUC;?>/js/jquery-1.11.3.js"></script>
    
</head>
<body>
<include file="Common/top" />
<div class="container clearfix">
    <include file="Common/left" />
    <!--/sidebar-->
    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="/jscss/admin">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">文章管理</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">
                <form action="" method="post" name="myform">
                    <table class="search-tab">
                        <tr>
                            <th width="120">选择分类:</th>
                            <td>
                                <select name="cateid" id="catid" class="required">
                                    <option value="">--请选择--</option>
                                    <volist name="cates" id="vo">
                                       <option value="{$vo.id}"<if condition="$vo.type neq 1">style="display:none;"</if> <if condition="$vo.id eq $cateid">selected</if> <if condition="$vo.id eq $cateid">selected</if>>
                                           <?php echo str_repeat('*',$vo['level']*2);?>{$vo.name}
                                       </option>
                                    </volist>
                                </select>
                            </td>
                            <th width="70">关键字:</th>
                            <td><input class="common-text" placeholder="关键字" name="kw" value="{$kw}" id="" type="text"></td>
                            <td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="result-wrap">
            <form   id="myform" method="post">
                <div class="result-title">
                    <div class="result-list">
                        <a href="__CONTROLLER__/add" class="btn btn-primary btn2"><i class="icon-font"></i>新增文章</a>
                        <a id="batchDel" ><i class="icon-font" ></i><input formaction="__CONTROLLER__/bdel"  class="btn btn-primary btn2" type="submit" value="批量删除"></a>
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th class="tc" width="5%"><input class="allChoose" id="check"  type="checkbox" ></th>
                            <th>ID</th>
                            <th>文章标题</th>
                            <th>是否推荐</th>
                            <th>缩略图</th>
                            <th>所属栏目</th>
                            <th>操作</th>
                        </tr>
                        <volist name="list" id='vo'>
                            <tr>
                                <td class="tc"><input name="ids[]" class='check' value="{$vo.id}" type="checkbox"></td>
                                <td>{$vo.id}</td>
                                <td title="发哥经典"><a target="_blank" href="#" title="发哥经典">{$vo.title}</a>
                                </td>
                                <td>
                                <if condition="$vo['rem'] eq 1">
                                推荐
                                <else/>
                                未推荐
                                </if>
                                </td>
                                <td>
                                <if condition="$vo['pic'] neq ''">
                                <img src="__ROOT__/{$vo.pic}" alt="" width="60px"></td>
                                <else/>
                                暂无缩略图
                                </if>
                                <td>{$vo.name}</td>
                                <td>
                                    <a class="link-update" href="__CONTROLLER__/edit/id/{$vo.id}">修改</a>
                                    <a class="link-del" href="__CONTROLLER__/del/id/{$vo.id}" onclick="return confirm('确定要删除文章吗？')">删除</a>
                                </td>
                            </tr>
                        </volist>
                    </table>
                    <div class="list-page">{$page}</div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
//jqurty点击批量选中全部的checkbox
$('#check').click(function(){
    if($(this).is(':checked')){
        //$(this).attr('checked')  jquery1.6之前没问题，之后不能用了
        $('.check').prop('checked',true);
    }else{
        $('.check').removeAttr('checked');
    }
})

//原生js点击批量选中全部的checkbox
//   function checkall(form) {
//     for(var i = 0;i < form.elements.length; i++) {
//         var e = form.elements[i];
//         if (e.name != 'chkall' && e.disabled != true) {
//             e.checked = form.chkall.checked;
//         }
//     }
// }
</script>
</body>
</html>